﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Big2.CardsLib;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.ComponentModel;

namespace Big2.Big2WfpGui
{
    public class CardImage : Image
    {

        public const int CardWidth = 72;
        public const int CardHeight = 96;


        public Card TheCard { get; set; }
        public bool Selected { get; set; }
        public bool FaceUp { get; set; }

        public const string imagePath = @"C:\Users\Duan\Documents\Visual Studio 2008\Projects\Big2\Big2WfpGui\images\";
        public string ImageFilename 
        { 
            get
            {
                if (FaceUp)
                    return  imagePath + TheCard.CardFileName();
                else
                    return imagePath + "Back Blue.png";
            }
        }


        public CardImage()
        {
            this.Width = CardWidth;
            this.Height = CardHeight;
            this.Stretch = Stretch.Fill;
        }

        public void SetSource()
        {
            SetSource(new BitmapImage(new Uri(ImageFilename)));
        }

        public void SetSource(ImageSource s)
        {
            this.Source=s;
        }
    }


}
